file_name=$1
target_path_pre=$2
file_path=$(printf "$target_path_pre/${file_name##*/}" | xxd -plain | tr -d '\n' | sed 's/\(..\)/%\1/g')
res=$(curl -XPOST \
  -H 'Content-Type:application/json' \
  -d'{"username":"nopass","password":"nopass"}' \
  'https://www.zxhtom.store/api/auth/login')
token=$(echo $res | jq -r '.data.token')
echo "----------"
echo $token
curl -XPUT 'https://www.zxhtom.store/api/fs/put' \
--header 'Authorization: '"${token}"'' \
--header 'File-Path: '"${file_path}"'' \
--header 'As-Task: true' \
--header 'Accept: */*' \
--header 'Host: www.zxhtom.store' \
--header 'Connection: keep-alive' \
--data-binary '@'"$file_name"''
